#ifndef IMAPSTUDIALOG_H
#define IMAPSTUDIALOG_H

#include <QDialog>
#include "QtNetwork/QTcpSocket"
#include "../../b-model/01-mail_model/folder_model/folderdatasource.h"
#include <QStringListModel>
#include "../../b-model/04-task/01-imap_task/imaptaskthread.h"
#include "../../b-model/04-task/01-imap_task/imapbasedata.h"
namespace Ui {
class ImapStuDialog;
}

class ImapStuDialog : public QDialog
{
    Q_OBJECT
public:
    QTcpSocket * mSocket;
    int smtpPort = 25;
    QString smtpServer = "smtp.qq.com";
    int imapPort = 143;
    QString imapServer = "imap.qq.com";
    QString mailAccount = "hmtest1028@qq.com";
    QString user = "hmtest1028";
    QString password = "fxbbpojgpmpvcijj";
    explicit ImapStuDialog(QWidget *parent = nullptr);
    ~ImapStuDialog();

private slots:
    void on_pushButton_clicked();
    void onSocketReceiveData();
    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    void on_btn_sendCmd_clicked();

    void on_pushButton_8_clicked();

    void on_pushButton_9_clicked();

    void on_pushButton_7_clicked();

    void on_pushButton_10_clicked();

    void on_pushButton_11_clicked();

    void on_pushButton_12_clicked();

    void on_pushButton_13_clicked();

    void on_btn_addFolder_clicked();

signals:
    void connectFinish2(QString ret);

private:
    Ui::ImapStuDialog *ui;
    void sendCmd(QString cmd);

    FolderDatasource * folderDatasource;
    QStringListModel * stringDatasource;
    ImapTaskThread * taskThread;
    ///@brief 在别的线程有函数对象传来

    // void onConnectTask(QString ret);
public slots:
    ///@brief 执行函数对象
    void onConnectFinish(QString ret);
    void onEvent(ImapTaskType type,QVariant ret,QVariant raw);
};

#endif // IMAPSTUDIALOG_H
